require('wx-mixins');
//app.js
import {
  api_host_prod,
  api_host_dev,
  img_host_prod,
  img_host_dev,
} from './config.js'
App({
  getHost() {
    return new Promise((resolve, reject) => {
      wx.setStorageSync('token', 'bNUXV6dwqUzAKXMHuKGPg3wyhh3ezC');
       //开发版(development))  体验版(trial)  发行版(release)
      if (__wxConfig.envVersion === "develop" || __wxConfig.envVersion === "trial") {
        this.host = api_host_dev;
        this.img_host = img_host_dev
      } else {
        this.host = api_host_prod;
        this.img_host = img_host_dev;
      }
      resolve({
        host: this.host,
        img_host: this.img_host
      })
    })
  }
})